<?php
	//引入配置文件和数据库操作函数
	require '../public/config.php';
	require '../public/mysql.php';
	require '../public/function.php';
	 session_start();
	 @$name= $_SESSION['admin']['user'];
	//连接数据库
	$link = connect();
	//数据库查询商品信息的数据
		if ($link['error']) {
			$sql = "select * from detail";
//		echo $sql;
			$result = query($link['mess'], $sql);
		}
		$order=$result;
//        var_dump($order);



		
?>

<html>
    <head>
	    <title>个人中心</title>
		<meta charset="utf-8">
		<link type="text/css" rel="stylesheet" href="style/reset.css">
		<link type="text/css" rel="stylesheet" href="style/orders.css">
	</head>

    <body>
	    <div class="headerBar">
		
		<div class="topBar">
		        <div class="comWidth">
				 <?php if (empty($_SESSION['admin']['user']) ) :?>
					<a href="./web/login.php">登录</a>
					<a href="./web/adduser.php">注册</a>
					<?php else :?>
					<p>欢迎回来，<?php echo $_SESSION['admin']['user'];?>
					<a href="./web/dologin.php?a=logout">退出</a></p>
					<?php endif;?>
				</div>
		</div>

         <div class="logoBar">
		      <div class="comWidth">
			      <div class="logo fl">
				    <a href="#"><img src="./images/logo.jpg" alt="汤浅蓄电池"></a>
				  </div>
				  <div class="search_box fl">
				      <input type="text" class="search_text fl">
					  <input type="button" value="搜 索" class="search_btn fr">
				  </div>
				  <div class="shopCar fr">
				      <span class="shopText fl">购物车</span>
					  <span class="shopNum fl">0</span>
				  </div>
			  </div>
		 </div>
<!--  导航-->
        <div class="nav comWidth">
		
		   <div class="nav_left">
		     <h3>全部商品分类</h3>  
		   </div>
		    <ul class="nav_right">
			   <li class="nav_active1">电瓶上门</li>
			   <li class="nav_active">轮胎</li>
			   <li class="nav_active">保养</li>
			   <li class="nav_active">车品</li>
			   <li class="nav_active">轮毂</li>
			   <li class="nav_active">服务门店</li>
		    </ul>
		
		
		
		</div>  

<!-- 内容 -->       
<div class="main w1210 bc mt10 comWidth">
		<div class="crumb w1210">
			<h2><strong>个人中心 </strong><span>> 我的订单</span></h2>
		</div>
		
		<!-- 左侧导航菜单 start -->
		<div class="menu fl">
			<h3>功能表</h3>
			<div class="menu_wrap">
				<dl>
					<dt>订单中心 <b></b></dt>
					<dd><b>.</b><a href="">我的订单</a></dd>
					<dd><b>.</b><a href="">我的关注</a></dd>
					<dd><b>.</b><a href="">浏览历史</a></dd>
					<dd><b>.</b><a href="">我的团购</a></dd>
				</dl>

				<dl>
					<dt>账户中心 <b></b></dt>
					<dd class="cur"><b>.</b><a href="">账户信息</a></dd>
					<dd><b>.</b><a href="">账户余额</a></dd>
					<dd><b>.</b><a href="">消费记录</a></dd>
					<dd><b>.</b><a href="">我的积分</a></dd>
					<dd><b>.</b><a href="">收货地址</a></dd>
				</dl>

				
			</div>
		</div>
		<!-- 左侧导航菜单 end -->

		<!-- 右侧内容区域 start -->
		   <div class="banner_left">
		      <table class="flow2_1" align="center" >
					<tr class="flow2_1_1">
						<th>订单号</th>
                <th>收货人</th>
                <th>商品名称</th>
                <th>商品价格</th>
                <th>商品数量</th>
                <th>用户ID</th>
					</tr>
					<?php
						//收货0,1替换
						$shipments = array(0=>'待发货', 1=>'已发货');
					?>
					<?php if(!$order==NULL): ?>
					<?php foreach($order as $val) : ?>
					<tr class="flow2_1_2">
						<td align='center'><?php echo $val['orderid']?></td>	
					<td align='center'><?php echo $val['name']?></td>
					<td align='center'><?php echo $val['Commodity']?></td>
					<td align='center'><?php echo $val['price']?></td>
					<td align='center'><?php echo $val['num']?></td>
					<td align='center'><?php echo $val['uid']?></td>
					</tr>
					<?php endforeach;?>
						<?php else: ?>
							<span>暂无商品</span>
							<?php endif; ?>
			</table>
		   
		   </div>
		<!-- 右侧内容区域 end -->
	</div>
	<!-- 页面主体 end-->

	
<!-- 商品详情结束 -->


<a style="margin-left:214px;"><img src="./images/weibu.jpg"></a>
    
























	</body>
</html>